package com.yx.shop.web.admin;

import com.yx.shop.common.Const;
import com.yx.shop.entitly.Orders;
import com.yx.shop.service.admin.AdminOrderService;
import com.yx.shop.service.admin.impl.AdminOrderServiceImpl;
import com.yx.shop.web.controller.BaseServlet;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @Classname AdminOrderContrtoller
 * @Description TODO:
 * @Date 2021/05/10 20:24
 * @Created by yx
 */
@WebServlet("/admin/order")
public class AdminOrderContrtoller extends BaseServlet {
    private AdminOrderService adminOrderService = new AdminOrderServiceImpl();

    /**
     * @Author:yx
     * @return java.lang.String
     * @Date 2021/05/10 20:31
     * @param request
     * @param response
     * @Description:获取所有的订单
     **/
    public String getAllOrder(HttpServletRequest request, HttpServletResponse response){
        List<Orders> ordersList = adminOrderService.getAllOrder();
        request.setAttribute("orderList",ordersList);
        return Const.FORWORD+"/admin/showAllOrder.jsp";
    }
}
